<template>
  <div id="body">
    <h1>手写一个简易的ajax</h1>
  </div>
</template>

<script setup>
const xhr = new XMLHttpRequest()
xhr.open('GET', '/data/text.json', true)
xhr.onreadystatechange = function () {
  if (xhr.readyState === 4) {
    if (xhr.status === 200) {
      alert(xhr.responseText)
    } else {
      alert('其他情况')
    }
  }
}

xhr.send(null)
</script>

<style scoped lang="scss"></style>
